package com.grass.appointment.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.androidx.p013lv.base.glide.GlideUtils;
import com.androidx.p013lv.base.interfaces.Key;
import com.androidx.p013lv.base.utils.ImageUtil;
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestBuilder;
import com.bumptech.glide.RequestManager;
import com.grass.appointment.C2694R;
import com.grass.appointment.bean.CoverBean;
import com.youth.banner.adapter.BannerAdapter;
import java.util.List;

public class CheckBannerAdapter extends BannerAdapter<CoverBean, BannerViewHolder> {
    private String domain;
    private boolean isSelf;

    public CheckBannerAdapter(List<CoverBean> list, String str, boolean z) {
        super(list);
        this.domain = str;
        this.isSelf = z;
    }

    @Override // com.youth.banner.adapter.IViewHolder
    public BannerViewHolder onCreateHolder(ViewGroup viewGroup, int i) {
        return new BannerViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(C2694R.C2699layout.item_check_img, viewGroup, false));
    }

    public void onBindView(BannerViewHolder bannerViewHolder, CoverBean coverBean, int i, int i2) {
        if (coverBean.getUrl().equals(Key.IC_APPOINTMENT_DEFAULT)) {
            GlideUtils.loadResId(ImageUtil.getResource(Key.IC_APPOINTMENT_DEFAULT), bannerViewHolder.imageView);
            if (this.isSelf) {
                bannerViewHolder.ivNormal.setVisibility(0);
            } else {
                bannerViewHolder.ivNormal.setVisibility(8);
            }
            bannerViewHolder.itemCheck.setVisibility(8);
            bannerViewHolder.itemCheck.setText("");
            return;
        }
        bannerViewHolder.ivNormal.setVisibility(8);
        RequestManager with = Glide.with(bannerViewHolder.imageView.getContext());
        ((RequestBuilder) with.load(this.domain + coverBean.getUrl()).placeholder(C2694R.C2696drawable.base_ic_default_cover)).into(bannerViewHolder.imageView);
        int status = coverBean.getStatus();
        if (status == 1) {
            bannerViewHolder.itemCheck.setVisibility(0);
            bannerViewHolder.itemCheck.setText("圖片審核中");
        } else if (status != 3) {
            bannerViewHolder.itemCheck.setVisibility(8);
            bannerViewHolder.itemCheck.setText("");
        } else {
            bannerViewHolder.itemCheck.setVisibility(0);
            bannerViewHolder.itemCheck.setText("審核未通過");
        }
    }

    /* access modifiers changed from: package-private */
    public static class BannerViewHolder extends RecyclerView.ViewHolder {
        ImageView imageView;
        TextView itemCheck;
        ImageView ivNormal;

        BannerViewHolder(View view) {
            super(view);
            this.imageView = (ImageView) view.findViewById(C2694R.C2697id.item_image);
            this.itemCheck = (TextView) view.findViewById(C2694R.C2697id.item_check);
            this.ivNormal = (ImageView) view.findViewById(C2694R.C2697id.iv_normal);
        }
    }
}
